#pragma once
#include <string>
#include <list>
#include "ThreadPool.h"
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libavdevice/avdevice.h>
#include <libavformat/avio.h>
#include <libavfilter/avfilter.h>
#include "libavutil/audio_fifo.h"
#include "libavfilter/buffersink.h"
#include <libavutil/imgutils.h>
#include "libavutil/samplefmt.h"
#include "libswresample/swresample.h"
#include "libavfilter/buffersrc.h"
}




#define VERIFY_RETURN(expr) \
    do {    \
        auto ret = expr;    \
        if(!ret) {  \
            return false;   \
        }   \
    } while (false);

#define VERIFY_RETURN_VOID(expr) \
    do {    \
        auto ret = expr;    \
        if(!ret) {  \
            return;   \
        }   \
    } while (false);


#define GUARD_LOCK(lock)    \
    std::lock_guard<std::mutex> locker(lock);

#define SHARED_LOCK(lock)    \
    std::unique_lock<std::mutex> locker(lock);